﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Mother.Master" AutoEventWireup="true"
    CodeBehind="Filter.aspx.cs" Inherits="WeiboFilter.Filter" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        #Weibo ul li
        {
            list-style-type: none;
            width: 650px;
            background-color: White;
            color: #8A8A8A;
            border-bottom-width: 1px;
            border-bottom-style: dashed;
            border-bottom-color: #000;
            margin-bottom: 5px;
        }
        .head_pic
        {
            float: left;
            width: 100px;
        }
        .weibo_status
        {
            margin-left: 100px;
            width: 350px;
        }
        .operate
        {
            background-color: White;
        }
        .remark
        {
            margin-left: 450px;
            width: 100px;
            font-weight: bolder;
        }
    </style>
    <script src="Scripts/jquery-1.5.1.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
        });
        function PassStatus(data) {
            newid = "#" + data;
            $(newid).hide();
        }
        function LikeHateOp(statusId, opName) {
            //效果
            identity = "#" + statusId;
            if (opName == "Hate") {
                $(identity).hide();
            }
            else {
                identity = "#display" + statusId;

                $(identity).html("<img src='Picture/Liked.png' alt='喜欢' />");
            }

            url = "Operate/LikeHate.aspx?id=" + statusId + "&op=" + opName;
            $.get(url, function (data) {
                //                alert("Data Loaded: " + data);
            });

        }
        function ShowStatus(url) {
            window.showModalDialog(url, "",
        "dialogWidth:1200px;dialogHeight:600px;resizable:no;scrollbars:no");
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2>
        微博过滤</h2>
    <div id="Weibo">
        <asp:Repeater ID="repWeibo" runat="server" OnItemDataBound="repWeibo_ItemDataBound">
            <HeaderTemplate>
                <ul>
            </HeaderTemplate>
            <ItemTemplate>
                <li id='<%# Eval("id") %>'>
                    <div class="head_pic">
                        <a href='<%# Eval("author.domain")%>'>
                            <img src='<%# Eval("author.profile_image_url")%>' alt='<%# Eval("author.screen_name")%>'
                                title='<%# Eval("author.description")%>' />
                        </a>
                    </div>
                    <div class="weibo_status">
                        <p class="text">
                            <a href='<%# Eval("author.domain")%>' title='<%# Eval("author.description")%>'>
                                <%# Eval("author.screen_name")%></a> ：<%# Eval("text") %>[<asp:LinkButton ID="LinkButton1"
                                    runat="server" Text="点击查看" OnClientClick='<%# GetClientClick(Eval("location")) %>' />]
                        </p>
                        <div class="operate">
                            <button id='display<%# Eval("id") %>' type="button" style="width: 40px; height: 40px"
                                onclick="LikeHateOp(<%# Eval("id")%>,'Like')">
                                <img src="Picture/like.png" alt="喜欢" /></button>
                            <button type="button" style="width: 40px; height: 40px" onclick="LikeHateOp(<%# Eval("id")%>,'Hate')">
                                <img src="Picture/Hate.png" alt="不喜欢" />
                            </button>
                            <button type="button" style="width: 40px; height: 40px" onclick="PassStatus(<%# Eval("id")%>)">
                                <img src="Picture/pass.png" alt="不想再看到" />
                            </button>
                        </div>
                    </div>
                    <div class="remark">
                        <asp:Label ID="lblScore" runat="server" Text='<%# Eval("point") %>' Visible="false"></asp:Label>
                        <asp:Label ID="lblState" runat="server" Text='<%# Eval("state") %>' Visible="false"></asp:Label>
                        <asp:Literal ID="litRemark" runat="server"></asp:Literal>
                    </div>
                </li>
            </ItemTemplate>
            <FooterTemplate>
                </ul></FooterTemplate>
        </asp:Repeater>
    </div>
    <div style="text-align: center">
        <asp:Button ID="btnNext" runat="server" Text="下一页" OnClick="btnNext_Click" /></div>
</asp:Content>